-
Notifications
You must be signed in to change notification settings - Fork 4k
feat(cli): add allowHeadless option for MCP servers in headless mode #9327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
1 similar comment
Learn moreAll Green is an AI agent that automatically: ✅ Addresses code review comments ✅ Fixes failing CI checks ✅ Resolves merge conflicts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 issues found across 7 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="extensions/cli/src/stream/mcp-headless.test.ts">
<violation number="1" location="extensions/cli/src/stream/mcp-headless.test.ts:238">
P2: Test claims to test `allowHeadless=undefined` but actually tests `allowHeadless=false` due to `?? false` coercion in the helper. To properly test undefined behavior, preserve the undefined value instead of defaulting to false.</violation>
</file>
<file name="extensions/cli/src/stream/handleToolCalls.ts">
<violation number="1" location="extensions/cli/src/stream/handleToolCalls.ts:206">
P1: The `allowMcpInHeadless` check doesn't respect explicit `"exclude"` permissions. If a tool is explicitly excluded in permissions but has `allowHeadless: true`, it will bypass the exclusion and be allowed in headless mode. The `allowHeadless` flag should only upgrade `"ask"` permissions to automatic approval, not override explicit exclusions.</violation>
</file>
Reply to cubic to teach it or ask questions. Tag @cubic-dev-ai to re-run a review.
📚 Documentation Updates AvailableI've created documentation updates for this feature in a separate branch: Changes OverviewReference Documentation (
MCP Deep Dive (
CLI Overview (
Next StepsYou can:
The documentation changes are scoped to explain the feature without adding unnecessary detail, using Mintlify components for effective information display. View the commit: 8aff77c |
📚 Documentation PR CreatedI've created PR #9328 with documentation updates for the The PR adds comprehensive documentation covering:
The documentation PR is ready to merge once this PR is merged. Preview: #9328 |
Adds `allowHeadless: true` config option for MCP servers, enabling
specific MCP tools to work in headless mode without requiring --auto flag.
Changes:
- Add allowHeadless to MCP config schema
- Pass allowHeadless from connection config to Tool objects
- Check allowHeadless in tool enumeration (getRequestTools)
- Check allowHeadless in execution permission (checkToolPermissionApproval)
- Respect explicit "exclude" permissions (allowHeadless cannot override)
- Add 9 tests covering enumeration, execution, and security scenarios
Usage:
```yaml
mcpServers:
- name: Brave Search
command: npx
args: ["-y", "@modelcontextprotocol/server-brave-search"]
allowHeadless: true # Enable in headless mode
```
Authored by: Aaron Lippold<[email protected]>
f6cd721 to
a054c6d
Compare
Mock core/util/paths.js to read CONTINUE_GLOBAL_DIR dynamically instead of caching it at module load time. This fixes test isolation issues where tests running in parallel would share the same GlobalContext file path. Root cause: The CONTINUE_GLOBAL_DIR constant in core/util/paths.ts is computed via an IIFE at module load time. When tests set different temp directories in beforeEach, the module had already cached the original value. Solution: Mock getContinueGlobalPath, getIndexFolderPath, and getGlobalContextFilePath to read process.env.CONTINUE_GLOBAL_DIR on each call, allowing proper test isolation. Also adds interopDefault to vitest config for better CommonJS handling. Authored by: Aaron Lippold<[email protected]>
a054c6d to
4db8aa8
Compare
Review Comments AddressedBoth AI review comments have been resolved: P1 (Security) -
|
RomneyDa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaronlippold if there are issues with MCP tools in headless I think that is a bug and we should allow any MCP tools which are included. Could you clarify if this would fix the issue you're addressing here? That is, rather than adding a configuration option, just make sure any MCP tools are enabled in headless?
|
That could be a different way to solve it. I can go through it again and see if that would fix it. |
1 similar comment
|
That could be a different way to solve it. I can go through it again and see if that would fix it. |
|
@aaronlippold double checked this with the team and confirmed that we want MCP tools to just work out of the box in headless, so likely just a tweak to tool permissions should fix. Currently when using That being said we should fix the bug where MCP tools simply aren't available in headless. I think the bug is likely here in tool permission service, where we don't actually have handling for the What are your thoughts on this? |
|
Hi, my goal is resolution of the functionality so if the team has a way
that they’re comfortable with resolving that it doesn’t have to be my Way.
I’m happy if we think there’s a more efficient path. Happy to work with the
team on that.
…--------
Aaron Lippold
***@***.***
260-255-4779
twitter/aim/yahoo,etc.
'aaronlippold'
On Tue, Jan 13, 2026 at 18:54 Dallin Romney ***@***.***> wrote:
*RomneyDa* left a comment (continuedev/continue#9327)
<#9327 (comment)>
@aaronlippold <https://github.com/aaronlippold> double checked this with
the team and confirmed that we want MCP tools to just work out of the box
in headless, so likely just a tweak to tool permissions should fix.
Currently when using --agent any MCP tools in the agent will be allowed,
and I think using --mcp you'd expect the same, so I think --config acting
differently is probably more confusing than not, although I agree that the
ultra-security conscious approach would be to default to false. I think for
now, security-conscious users can pass a custom --config or use --mcps
with only the tools they want.
That being said we should fix the bug where MCP tools simply aren't
available in headless, with a tweak to tool permissions, likely to call out
all the built ins specifically and then allow any others.
What are your thoughts on this?
—
Reply to this email directly, view it on GitHub
<#9327 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AALK42HJZCWDSMULE5S3CZ34GWAR5AVCNFSM6AAAAACQCC6W46VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTONBXGA3DCMRRHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|

Description
Adds
allowHeadless: trueconfig option for MCP servers, enabling specific MCP tools to work in headless mode without requiring the--autoflag.Problem: MCP tools are unavailable in headless mode, limiting automation scenarios where users want specific trusted MCP servers to work while still requiring approval for other tools.
Solution: Per-server
allowHeadlessoption that allows enumeration and execution of tools from that server in headless mode.Usage:
Changes
Commit 1: Feature (
4062ff6)allowHeadlessto MCP config schema (packages/config-yaml)allowHeadlessfrom connection config to Tool objectsallowHeadlessin tool enumeration (getRequestTools)allowHeadlessin execution permission (checkToolPermissionApproval)allowHeadlessrespects explicit "exclude" permissions (won't override user denials)mcp-headless.test.tsCommit 2: Test Isolation Fix (
4db8aa8)core/util/paths.jsto readCONTINUE_GLOBAL_DIRdynamicallyGlobalContextsingleton would leak state between parallel test filesinteropDefault: trueto vitest config for better CommonJS handlingAI Code Review
@continue-reviewChecklist
Screen recording or screenshot
N/A - This is a CLI/config change with no UI impact.
Tests
Added 9 unit tests in
extensions/cli/src/stream/mcp-headless.test.ts:Tool enumeration tests (4):
allowHeadless=truein headless modeallowHeadlessallowHeadlesssettingsExecution permission tests (5):
allowHeadless=truein headless modeallowHeadlessin headless modeallowHeadless=undefinedin headless modeallowHeadlessallowHeadless=true(security test)All existing tests continue to pass (1715 unit tests, 66 e2e tests).